/*
 * @Descripttion:
 * @version:
 * @Author: caiailing
 * @Date: 2023-03-29 14:42:43
 * @LastEditors:
 * @LastEditTime: 2023-04-04 17:29:10
 */
// 获取系统信息
export default defineStore({
  id: 'app',
  state: () => {
    return {
      systemInfo: {}
    } as {
      systemInfo: UniApp.GetSystemInfoResult
    }
  },
  actions: {
    getSystemInfo(): UniApp.GetSystemInfoResult {
      if (Object.keys(this.systemInfo).length) return this.systemInfo
      const systemInfo = uni.getSystemInfoSync()
      Object.assign(this.systemInfo, systemInfo)
      return systemInfo
    }
  }
})
